﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace iri10
{
    public partial class frmSeleccionarTipo : Form
    {
        private PictureBox picSelDesktop;
        private PictureBox picDesktop;
        private Label lblDesktop;
        private PictureBox picSelNotebook;
        private PictureBox picNotebook;
        private Label lblNotebook;

        //indica que esta seleccionado
        const int NOTEBOOK = 1;
        const int DESKTOP = 2;
        private PictureBox picNext;
        private int iSeleccionado = NOTEBOOK;

        public frmSeleccionarTipo()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSeleccionarTipo));
            this.picSelDesktop = new System.Windows.Forms.PictureBox();
            this.picDesktop = new System.Windows.Forms.PictureBox();
            this.lblDesktop = new System.Windows.Forms.Label();
            this.picSelNotebook = new System.Windows.Forms.PictureBox();
            this.picNotebook = new System.Windows.Forms.PictureBox();
            this.lblNotebook = new System.Windows.Forms.Label();
            this.picNext = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.picSelDesktop)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picDesktop)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picSelNotebook)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picNotebook)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picNext)).BeginInit();
            this.SuspendLayout();
            // 
            // picSelDesktop
            // 
            this.picSelDesktop.BackColor = System.Drawing.Color.Transparent;
            this.picSelDesktop.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picSelDesktop.Location = new System.Drawing.Point(15, 12);
            this.picSelDesktop.Name = "picSelDesktop";
            this.picSelDesktop.Size = new System.Drawing.Size(259, 92);
            this.picSelDesktop.TabIndex = 4;
            this.picSelDesktop.TabStop = false;
            this.picSelDesktop.Click += new System.EventHandler(this.picSelDesktop_Click);
            // 
            // picDesktop
            // 
            this.picDesktop.BackColor = System.Drawing.Color.Transparent;
            this.picDesktop.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picDesktop.Image = ((System.Drawing.Image)(resources.GetObject("picDesktop.Image")));
            this.picDesktop.Location = new System.Drawing.Point(158, 20);
            this.picDesktop.Name = "picDesktop";
            this.picDesktop.Size = new System.Drawing.Size(86, 75);
            this.picDesktop.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.picDesktop.TabIndex = 5;
            this.picDesktop.TabStop = false;
            this.picDesktop.Click += new System.EventHandler(this.picDesktop_Click);
            // 
            // lblDesktop
            // 
            this.lblDesktop.AutoSize = true;
            this.lblDesktop.BackColor = System.Drawing.Color.Transparent;
            this.lblDesktop.Cursor = System.Windows.Forms.Cursors.Hand;
            this.lblDesktop.Font = new System.Drawing.Font("Calibri", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblDesktop.Location = new System.Drawing.Point(37, 41);
            this.lblDesktop.Name = "lblDesktop";
            this.lblDesktop.Size = new System.Drawing.Size(108, 33);
            this.lblDesktop.TabIndex = 6;
            this.lblDesktop.Text = "Desktop";
            this.lblDesktop.Click += new System.EventHandler(this.lblDesktop_Click);
            // 
            // picSelNotebook
            // 
            this.picSelNotebook.BackColor = System.Drawing.Color.Transparent;
            this.picSelNotebook.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picSelNotebook.Location = new System.Drawing.Point(15, 128);
            this.picSelNotebook.Name = "picSelNotebook";
            this.picSelNotebook.Size = new System.Drawing.Size(259, 92);
            this.picSelNotebook.TabIndex = 7;
            this.picSelNotebook.TabStop = false;
            this.picSelNotebook.Click += new System.EventHandler(this.picSelNotebook_Click);
            // 
            // picNotebook
            // 
            this.picNotebook.BackColor = System.Drawing.Color.Transparent;
            this.picNotebook.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picNotebook.Image = ((System.Drawing.Image)(resources.GetObject("picNotebook.Image")));
            this.picNotebook.Location = new System.Drawing.Point(33, 134);
            this.picNotebook.Name = "picNotebook";
            this.picNotebook.Size = new System.Drawing.Size(94, 80);
            this.picNotebook.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.picNotebook.TabIndex = 8;
            this.picNotebook.TabStop = false;
            this.picNotebook.Click += new System.EventHandler(this.picNotebook_Click);
            // 
            // lblNotebook
            // 
            this.lblNotebook.AutoSize = true;
            this.lblNotebook.BackColor = System.Drawing.Color.Transparent;
            this.lblNotebook.Cursor = System.Windows.Forms.Cursors.Hand;
            this.lblNotebook.Font = new System.Drawing.Font("Calibri", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblNotebook.Location = new System.Drawing.Point(133, 152);
            this.lblNotebook.Name = "lblNotebook";
            this.lblNotebook.Size = new System.Drawing.Size(128, 33);
            this.lblNotebook.TabIndex = 10;
            this.lblNotebook.Text = "Notebook";
            this.lblNotebook.Click += new System.EventHandler(this.lblNotebook_Click);
            // 
            // picNext
            // 
            this.picNext.BackColor = System.Drawing.Color.Transparent;
            this.picNext.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picNext.BackgroundImage")));
            this.picNext.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
            this.picNext.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picNext.Location = new System.Drawing.Point(205, 226);
            this.picNext.Name = "picNext";
            this.picNext.Size = new System.Drawing.Size(69, 50);
            this.picNext.TabIndex = 11;
            this.picNext.TabStop = false;
            this.picNext.Click += new System.EventHandler(this.picNext_Click);
            // 
            // frmSeleccionarTipo
            // 
            this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.ClientSize = new System.Drawing.Size(287, 280);
            this.Controls.Add(this.picNext);
            this.Controls.Add(this.lblNotebook);
            this.Controls.Add(this.picNotebook);
            this.Controls.Add(this.picSelNotebook);
            this.Controls.Add(this.lblDesktop);
            this.Controls.Add(this.picDesktop);
            this.Controls.Add(this.picSelDesktop);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Location = new System.Drawing.Point(0, -600);
            this.Name = "frmSeleccionarTipo";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "Seleccionar Tipo Pc";
            this.Load += new System.EventHandler(this.frmSeleccionarTipo_Load);
            this.Shown += new System.EventHandler(this.frmSeleccionarTipo_Shown);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmSeleccionarTipo_FormClosing);
            ((System.ComponentModel.ISupportInitialize)(this.picSelDesktop)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picDesktop)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picSelNotebook)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picNotebook)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picNext)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void frmSeleccionarTipo_Load(object sender, EventArgs e)
        {
            picSelDesktop_Click(null, null);

        }

        private void seleccionarTipo(Boolean desktop)
        {
            //Les pongo color
            if (desktop)
            {
                picDesktop.BackColor = picSelDesktop.BackColor = lblDesktop.BackColor = Color.Green;
                picNotebook.BackColor = picSelNotebook.BackColor = lblNotebook.BackColor = Color.Transparent;
                iSeleccionado = DESKTOP;
            }
            else
            {
                picDesktop.BackColor = picSelDesktop.BackColor = lblDesktop.BackColor = Color.Transparent;
                picNotebook.BackColor = picSelNotebook.BackColor = lblNotebook.BackColor = Color.Green;
                iSeleccionado = NOTEBOOK;
            }
        }

        private void picSelDesktop_Click(object sender, EventArgs e)
        {
            seleccionarTipo(true);
        }

        private void picDesktop_Click(object sender, EventArgs e)
        {
            seleccionarTipo(true);
        }

        private void lblDesktop_Click(object sender, EventArgs e)
        {
            seleccionarTipo(true);
        }

        private void lblNotebook_Click(object sender, EventArgs e)
        {
            seleccionarTipo(false);
        }

        private void picNotebook_Click(object sender, EventArgs e)
        {
            seleccionarTipo(false);
        }

        private void picSelNotebook_Click(object sender, EventArgs e)
        {
            seleccionarTipo(false);
        }

        private void frmSeleccionarTipo_Shown(object sender, EventArgs e)
        {
            //320 - 158

            Point p = new Point();
            p.X = 320;
            p.Y = -Height;

            this.Visible = true;

            for (int iCont = 0; iCont <= 25; iCont++)
            {
                p.Y += (158 + this.Height) / 25;
                this.Location = p;
                Application.DoEvents();
            }

        }

        private void frmSeleccionarTipo_FormClosing(object sender, FormClosingEventArgs e)
        {
            ocultar();
            NegVentanas.refreshMain();
        }

        private void picNext_Click(object sender, EventArgs e)
        {
            if (iSeleccionado == NOTEBOOK)
                pcActual.PcActual = new Notebook();
            else
                pcActual.PcActual = new Desktop();

            NegVentanas.showSeleccionarPcBase();
        }

        public void ocultar()
        {
            Point p = new Point();
            p.X = 320;
            p.Y = Location.Y;


            //Me voy llendo
            for (int iCont = 15; iCont >= 0; iCont--)
            {
                p.Y -= (158 + this.Height) / 15;
                this.Location = p;
                Application.DoEvents();
            }
            this.Visible = false;
            NegVentanas.refreshMain();

        }


    }
}
